package com.example.chuqq.gpssigninapplication;

import android.app.Application;
import android.content.Intent;
import android.util.Log;

import com.example.chuqq.gpssigninapplication.model.UserData;

public class MainApplication extends Application {
    private static final String TAG = "MainApplication";

    @Override
    public void onCreate() {
        super.onCreate();

        Log.d(TAG, "MainApplication.onCreate()");

        UserData userData = new UserData(this);
        if (userData.getPhone() == null || "".equals(userData.getPhone())) {
            return;
        }

        Intent mainService = new Intent(getApplicationContext(), MainService.class);
        startService(mainService);

        Intent watcherService = new Intent(getApplicationContext(), WatcherService.class);
        startService(watcherService);
    }
}
